import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import render from '@dfeidao/atom-mobile/render/render';
import get from '@dfeidao/atom-mobile/storage/get';
import set from '@dfeidao/atom-mobile/storage/set';

interface Iarr {
	id: number;
	text: string;
	show: boolean;
}
export default async function a003(fd: IFeidaoAiMobile, option: Iarr) {
	option.show ? option.show = false : option.show = true;
	const arr = JSON.parse(await get('arr')) as Iarr[];
	arr.filter((item) => {
		item.id === option.id ?
			item.show = option.show :
			item.show = false;
	});
	set('arr', JSON.stringify(arr));
	render(fd, { arr, fd });
}
